﻿using OA.Core.Model;
using System;
using System.Collections.Generic;
using System.Linq;

namespace OA.Core.Helper
{
    public static class StringHelper
    {
        public static List<ListItem> ToListItems(this string value)
        {
            if (string.IsNullOrWhiteSpace(value)) { return new List<ListItem>(); }
            return value.Split(new string[] { ",", "，" }, StringSplitOptions.RemoveEmptyEntries).Select(m => new ListItem() { Value = m, Text = m }).ToList();
        }
    }
}
